﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace AsycServer
{
    /// <summary>
    /// 定义代理
    /// </summary>
    public partial class AsyUdpServer
    {
        public delegate void StartHandle();
        public delegate void ConnectHandle(Client c);
        public delegate void MessageHandle(Client c, MessageBuffer m);
        public delegate void MessageExtHandle(IPEndPoint ip, MessageBuffer m);
        public delegate void DisconnectHandle(Client c);
        public delegate void ExceptionHandle(Exception e);
        public delegate void PingHandle(Client c, int millis);
        public delegate void DebugHandle(string msg);
        
        public event StartHandle OnStart;
        public event ConnectHandle OnConnect;
        public event DisconnectHandle OnDisconnect;
        public event MessageHandle OnMessage;
        public event MessageExtHandle OnMessageExternal;
        public event ExceptionHandle OnException;
        public event PingHandle OnPing;
        public event DebugHandle OnDebug;
    }
}
